package com.source.exercise.jvmjmm;

/**
 * @Author wengqy
 * @Date 2020/12/26
 */
public class ClassLoaderDemo01 {
    public static void main(String[] args) {
     /*   System.out.println(ClassLoaderDemo01.class.getClassLoader()); // sun.misc.Launcher$AppClassLoader@18b4aac2
        System.out.println(ClassLoaderDemo01.class.getClassLoader().getParent()); // sun.misc.Launcher$ExtClassLoader@1b6d3586
        System.out.println(ClassLoaderDemo01.class.getClassLoader().getParent().getParent()); // null
        System.out.println(ClassLoaderDemo01.class.getClassLoader().getParent().getParent()); // null
        System.out.println(ClassLoaderDemo01.class.getDeclaredClasses()); // [Ljava.lang.Class;@4554617c
        System.out.println(ClassLoaderDemo01.class.getDeclaringClass()); // null
        System.out.println(ClassLoaderDemo01.class.getEnclosingClass()); // null
        System.out.println(ClassLoaderDemo01.class.getClass());  //  class java.lang.Class
        System.out.println(ClassLoaderDemo01.class);  //  class com.source.jmm.classload.ClassLoaderDemo01
        ClassLoaderDemo01  c= new ClassLoaderDemo01();
        System.out.println(c.ss());*/


        long max = Runtime.getRuntime().maxMemory();
        long total = Runtime.getRuntime().totalMemory();
        System.out.println("max:"+max+"字节：max："+(max/(double)1024/1024)+" M"); // 3609.0 M   * 4   =  14443
        System.out.println("total:"+total+"字节：total："+(total/(double)1024/1024)+" M"); //  243.5 M  *64 = 15584

    }


    public String ss(){
        int a = 0;
        System.out.println(a);
        return "";
    }
}
